const express = require('express');
const app = express();
const router = require('./mod');


const qs = require('querystring')
const bodyParser = (req, res, next) => {
    let str = ''
    req.on('data', (chunk) => {
        str += chunk
    })
    req.on('end', () => {
        req.body = qs.parse(str)
        next()
    })
}

app.use(bodyParser)



app.use('/api', router);
app.use('/html', express.static('./public/1.html'))


app.listen(3000, () => {
    console.log('启动成功');
});